package com.tanhua.manage.controller;


import com.tanhua.manage.service.LogPageService;
import com.tanhua.manage.vo.PageResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("management/manage")
public class LogPageController {
    @Autowired
    private LogPageService logPageService;

    @GetMapping("logs")
    public PageResult queryLogList(
            @RequestParam("pagesize")String pageSize,   //页尺寸
            @RequestParam("page")String page,   //当前页码
            @RequestParam("sortProp")String sortProp,  //排序字段
            @RequestParam("sortOrder")String sortOrder,  //ascending升序,descending降序
            @RequestParam(value = "type",required = false)String type,  //类型01用户登录
            @RequestParam("uid")String uid    //用户Id
    ){
        PageResult pageResult = this.logPageService.queryLogList(page,pageSize,sortProp,sortOrder,type,uid);
        return pageResult;
    }
}
